<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <form action = "<?php echo $_SERVER[’PHP_SELF’]; ?>" method = "GET">
                    <table border="1">
                        <thead>
                            <tr>
                                <th>Akalinity Converter</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                 <td><label>Alkalinity:</label> <input type = "text" name = "alk" size=4> 
                                 <select name="scale"> 
                                     <option value="dkh ">DKH</option> 
                                     <option value="meq">Meq/L</option> 
                                 </select> <br/> 
                                 <input type = "submit" name = "Convert Alk"/> </td>
                            </tr>
                        </tbody>
                    </table>
                    </form>
                    
                    <!--PHP conversion function for temperature-->
                    <?php
                    if ($scale == "dkh") {print "<table border><tr><th colspan=2> Conversion Results</th></tr><tr><td>$alk</td><td>DKH</td></tr>"; 
                    $d_2_m = $alk/2.8; print "<tr><td>$d_2_m</td><td>MEQ/L</td></tr>";}
                    if ($scale == "meq") {print "<table border><tr><th colspan=2> Conversion Results</th></tr><tr><td>$alk</td><td>DKH</td></tr>"; 
                    $m_2_d = $alk*2.8; print "<tr><td>$m_2_d</td><td>DKH</td></tr>";}
                    ?>
    </body>
</html>
